package org.xue.snowmall.product.web;

import entity.GoodsEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.xue.snowmall.common.utils.PageUtils;
import org.xue.snowmall.product.service.GoodsService;
import org.xue.snowmall.product.vo.ParamsPsmVo;

import java.util.Map;

/**
 * @author 小刘的小张
 * @version 1.0
 * @description: TODO
 * @date 2021/9/22 14:55
 */
@Controller
public class WebProductController {

    @Autowired
    private GoodsService goodsService;

    @RequestMapping("/")
    public String item(ParamsPsmVo vo
            , Model model
            , @RequestParam Map<String, Object> params) {

        PageUtils<GoodsEntity> list = goodsService.queryPage(params);
        model.addAttribute("list", list);
        return "item";
    }
}
